package com.example.demo.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: DELL
 * Date: 2023-05-30
 * Time: 20:32
 */

@RestController
public class UserController {
    // 连接点 -- 触发切点的方法
    @RequestMapping("/user/count")
    public String fun1() {
        System.out.println("执行了 count 方法");
        int count = 0;
        for(int i = 0; i < 1000000000; i++) {
            count++;
        }
        return "统计方法";
    }

    // 连接点 -- 触发切点的方法
    @RequestMapping("/user/fun2")
    public String fun2() {
        System.out.println("执行了 fun2 方法");
        return "fun2 方法";
    }

    @RequestMapping("/user/article")
    public String login1() {
        System.out.println("执行了查看文章功能中的登陆检验");
        return "Spring AOP";
    }

    @RequestMapping("user/write")
    public String login2() {
        System.out.println("执行了写文章功能中的登录检验");
        return "Spring AOP";
    }

    @RequestMapping("user/login")
    public String login() {
        System.out.println("执行登陆操作 ");
        return "Spring AOP";
    }



}
